<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>

</body>
<script>
    function SuperType() {
        this.property = 1222222;
    }
    SuperType.prototype.getSuperValue = function () {
        return this.property;
    };

    console.log(SuperType.prototype.getSuperValue())
    function SubType() {
        this.subproperty = false;
    } 

    //继承了SuperType 
    SubType.prototype = new SuperType();
    SubType.prototype.getSubValue = function () {
        return this.subproperty;
    };
    console.log(SubType.prototype.getSuperValue())
    console.log(SubType.prototype.getSubValue());
  
    var instance = new SubType();
    console.log(instance)
    // alert(instance.getSuperValue()); //true 
</script>

</html>